{include file="header.html"}
<style>
body{overflow: hidden;}
</style>
<script>
	$(function() {
        $("#g_carrier_img").live('click',function(){
            $w=$(window).width();
            $h=$(window).height();
            $w=$w*0.7;
            $("#opframe").attr("src","index.php?app=datarefer&act=chooseop");
            $("#opframe").width($w);
            $.colorbox({
                width : $w+20,
                height : "450px",
                inline : true,
                href : "#oplist"
            });
        });
        $("#btnsubmit").click(function() {
            var can = true;
            var item = 0;
            var carrier = $('#g_carrier').val();
            if(carrier==""){
                $("g_carrier_name").addClass("error");
                alert("请选择承运商");
                can = false;
                return false;
            }
            $("[id^='cnum_']").each(function() {
                if (!this.checked) {
                    return true;
                }
                var i = $(this).attr('item');
                item++;
               /* var v = $("#num_" + i).val();
                var max = $("#num_" + i).attr('max');
                if (v == "" || isNaN(v) || parseInt(v) >parseInt(max)||parseInt(v)<=0) {
                    $("#num_" + i).addClass("error");
                    can = false;
                }*/
            });
            if (item <= 0) {
                alert("请选择指派数据");
                return false;
            }
            if (can) {
                $("#acategory_form").submit();
            }
        });
    })
    function changeop(id,name){
        $('crframe').colorbox.close();
        $("#g_carrier").val(id);
        $("#g_carrier_name").val(name);
    }

</script>
<div id="rightTop">
	<p>选择承运商</p>
</div>

<div class="tdare">
	<form method="post" enctype="multipart/form-data" id="acategory_form" action="index.php?app=goodsless&amp;act=goodslessdone">
        <div class="left" style="padding: 10px 0; position: relative;" >
            {if $unit!=0}
            <input type="hidden" value="{$unit}" name="g_carrier" id="g_carrier">
            选择承运商:<input type="text"  placeholder="承运商必填" value="{$o_name}" name="g_carrier_name" id="g_carrier_name">
            {else}
            <input type="hidden" value="" name="g_carrier" id="g_carrier">
            选择承运商:<input type="text"  placeholder="承运商必填" value="" name="g_carrier_name" id="g_carrier_name">
            <a href="javascript:void(0);" class="right_a" style="margin: 5px 3px 0 0" id="g_carrier_img" ><img src="templates/images/newadmin/serch.png" alt=""></a>
            {/if}
        </div>
		<input type="hidden" name="gs_gtid" value="{$gs_gtid}" id="gs_gtid">
		<table width="100%" cellspacing="0" class="dataTable">
			<!--{if $less}-->
			<tr class="tatr1">
				<td width="20" class="firstCell">
                    <input type="checkbox" class="checkall" />
				</td>
				<td>品名</td>
				<td>件数</td>
				<td>重量</td>
                <td>尺码</td>
                <td>承运商</td>
			</tr>
			<!--{/if}-->
			<!--{foreach from=$less item=g}-->
			<tr class="tatr2">
				<td class="firstCell">
                    {if $less && $g.ws_new<=0}
                        <input type="checkbox" name="cnum[{$g.gs_tid}]" id="cnum_{$g.gs_tid}" class="checkitem" value="1" item="{$g.gs_tid}" />
                    {/if}
				</td>
				<td>{$g.gs_name}</td>
				<td>{$g.gs_piece}</td>
                <td>{$g.gs_weight}</td>
				<td>{$g.gs_size}</td>
                <td>{$g.o_name}</td>
			</tr>
			<!--{foreachelse}-->
			<tr class="no_data">
				<td colspan="10">{$lang.no_data}</td>
			</tr>
			<!--{/foreach}-->
		</table>

		<!--{if $less}-->
		<div >
			<div class="left paddingT15" >&nbsp;&nbsp;</div>
			<div class="pageLinks">{include file=page.bottom.html}</div>
			<div >
				<div class="left paddingT15" style="padding-top: 10px;">
					&nbsp;&nbsp;
                    <input class="formbtn" type="button" value="确定" name="id" id="btnsubmit" />
				</div>
			</div>
			<div class="clear"></div>
		</div>
		<!--{/if}-->
	</form>
</div>
<div style="display: none"  >
    <div id="oplist">
        <iframe id="opframe" width="" height="600px" frameborder="0" scrolling="no"></iframe>
    </div>
</div>
{include file="footer.html"}
